//
//  Fenlei2Cell.m
//  Miss
//
//  Created by 军哥 on 15-1-29.
//  Copyright (c) 2015年 Alan. All rights reserved.
//

#import "Fenlei2Cell.h"

@interface Fenlei2Cell()
- (void)setFenlei2cell;

@end


@implementation Fenlei2Cell
- (void)dealloc
{
    [_titleImage2 release];
    [_titleLabel2 release];
    [_pictureImage2 release];
    [_BackGview2 release];
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self setFenlei2cell];
        
    }
    return self;
}
- (void)setFenlei2cell
{
    //最大的view
    self.BackGview2 = [[UIView alloc]init];
    //设置那个圆角的有多圆
    self.BackGview2.layer.cornerRadius = 5;
    //反着 适应 圆边角
    self.BackGview2.layer.masksToBounds = YES;
    [self.contentView addSubview:self.BackGview2];
    [_BackGview2 release];
    
    //图片imageview
    self.pictureImage2 = [[UIImageView alloc]init];
    [self.BackGview2 addSubview:_pictureImage2];
    [_pictureImage2 release];
    
    
    //副标题label
    self.titleLabel2 = [[UILabel alloc]init];
    [self.BackGview2 addSubview:self.titleLabel2];
    [_titleLabel2 release];
    
    //图片标题imageview
    self.titleImage2 = [[UIImageView alloc]init];
    [self.pictureImage2 addSubview:self.titleImage2];
    [_titleImage2 release];
    
    
    //最后统一删掉
    _BackGview2.backgroundColor = [UIColor redColor];
    _pictureImage2.backgroundColor = [UIColor cyanColor];
    _titleLabel2.backgroundColor = [UIColor greenColor];
    _titleImage2.backgroundColor = [UIColor yellowColor];
    
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    
    _BackGview2.frame = CGRectMake(self.contentView.frame.size.width/3, 10, self.contentView.frame.size.width*2/3-10, self.contentView.frame.size.height-20);
    
    _pictureImage2.frame = CGRectMake(0, 0, self.BackGview2.frame.size.width, self.BackGview2.frame.size.height*4/5);
    
    _titleLabel2.frame = CGRectMake(0, self.BackGview2.frame.size.height*4/5, self.BackGview2.frame.size.width, self.BackGview2.frame.size.height/5);
    
    _titleImage2.frame = CGRectMake(10, 10, 100, self.pictureImage2.frame.size.height/2);
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
